package com.zx.flow.api.listener.request;

import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Date;
import java.util.List;
import lombok.Data;

@Data
@Schema(title = "流程节点", description = "流程节点[用于与客户端监听器传输数据，确保数据量不会太大]")
public class FlowNode4Listener {

    @Schema(description = "节点id, uuid", example = "7cf79580-07c9-4bf1-b061-51561a6748ee")
    private String id;

    @Schema(description = "流程id", example = "6cf79580-07c9-4bf1-b061-51561a6748ee")
    private String flowId;

    @Schema(description = "节点开始时间", example = "2023-12-04 14:06:59")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date startDateTime;

    @Schema(description = "节点结束时间", example = "2023-12-04 14:06:59")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date endDateTime;

    @Schema(description = "触发的事件", example = "nodeApproved")
    private String eventCode;
    @Schema(description = "触发的事件", example = "流程通过")
    private String eventName;

    @Schema(description = "从哪个节点过来的", example = "5cf79580-07c9-4bf1-b061-51561a6748ee")
    private String nodeFormId;
    @Schema(description = "从哪个节点过来的", example = "node1")
    private String nodeFormCode;
    @Schema(description = "从哪个节点过来的", example = "提交申请")
    private String nodeFormName;

    @Schema(description = "当前节点", example = "node2")
    private String nodeCurrentCode;
    @Schema(description = "当前节点", example = "第一个人审批")
    private String nodeCurrentName;

    @Schema(description = "去哪个节点，未审批的时候为空", example = "4cf79580-07c9-4bf1-b061-51561a6748ee")
    private String nodeToId;
    @Schema(description = "去哪个节点，未审批的时候为空", example = "node3")
    private String nodeToCode;
    @Schema(description = "去哪个节点，未审批的时候为空", example = "第二个人审批")
    private String nodeToName;

    @Schema(description = "允许审批人员的列表")
    private List<FlowOperator4Listener> operators;

    @Schema(description = "真实操作的人员信息")
    private FlowOperator4Listener operator;

    @Schema(description = "审批意见", example = "同意~~")
    private String remark;

    @Schema(description = "节点顺序，用于排序，从0开始", example = "0")
    private Integer nodeIdx;

    @Schema(description = "子流程ID[流程的每个节点都可能触发子流程]", example = "3cf79580-07c9-4bf1-b061-51561a6748ee")
    private String subFlowId;

    @Schema(description = "节点状态, doing 进行中；finish 完成", example = "doing")
    private String status;

    @Schema(description = "创建时间", format = "datetime", example = "2023-12-04 14:06:59")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Schema(description = "更新时间", format = "date", example = "2023-12-04 14:06:59")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
}
